﻿using DevExpress.Utils;
using DevExpress.Utils.Win;
using DevExpress.XtraEditors.Popup;
using DevExpress.XtraGrid.Demos.util;
using DevExpress.XtraGrid.Editors;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraLayout;
using DXApplicationTangche.DTO;
using DXApplicationTangche.UC.款式尺寸;
using DXApplicationTangche.UC.货号管理.service;
using DXApplicationTangche.Utils;
using mendian;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.货号管理
{
    public partial class Form款式迭代一览 : DevExpress.XtraEditors.XtraForm
    {
        #region 变量
        private String styleId; //标准款式id
        private String styleCode; //标准款式名称
        private String styleNameCN;//标准款式名称
        private String styleSonCode;//子款号
        private List<styleSaleCountDTO> styleSaleCountDTOs = new List<styleSaleCountDTO>();//款号和销量
        private List<CraftDesignStyleRelationDTO> craftDesignStyleRelationDTOs外观 = new List<CraftDesignStyleRelationDTO>();//款式下外观设计点
        private List<CraftDesignStyleRelationDTO> craftDesignStyleRelationDTOs工艺 = new List<CraftDesignStyleRelationDTO>();//款式下工艺设计点
        private List<CraftDesignStyleRelationDTO> craftDesignStyleRelationDTOs全部 = new List<CraftDesignStyleRelationDTO>();//款式下外观及工艺设计

        private Model款式加外观 model;
        //private List<CraftFacadeDesignDTO带图> craftFacadeDesignDTO带图s = new List<CraftFacadeDesignDTO带图>();//带图的dtos
        private CraftFacadeDesignImportDTO craftFacadeDesignImportDTO = new CraftFacadeDesignImportDTO();
        private List<String> craftIds = new List<string>();//要添加到款式下的工艺设计Id
        #endregion
        public Form款式迭代一览()
        {
            InitializeComponent();
        }
        public Form款式迭代一览(String styleId, String styleCode,String styleNameCN)
        {
            this.styleId = styleId;
            this.styleCode = styleCode;
            this.styleNameCN = styleNameCN;
            this.styleSonCode = styleCode;
            InitializeComponent();
            this.textBox标准款款号.Text = this.styleCode;
            this.textBox款式名称.Text = this.styleNameCN;
            this.Load销量();
        }

        #region 查询
        private void Load销量()
        {
            try
            {
                this.styleSaleCountDTOs = 款式迭代Service.getSaleCountByStyleNameCn(this.styleId);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            this.gridControl款式销量.DataSource = this.styleSaleCountDTOs;
            this.gridView款式销量.RefreshData();
        }
        
        private void Load款式下的工艺设计点()
        {
            try
            {
                this.craftDesignStyleRelationDTOs工艺 = 款式迭代Service.getCraftStyleDesignDTOs(CraftTypeConst.PROCESS_PLANNING, this.styleSonCode);
            }
            catch 
            {
                MessageBox.Show("无工艺设计点");
            }
            this.gridControl款式下工艺一览.DataSource = this.craftDesignStyleRelationDTOs工艺;
            this.gridView款式下工艺一览.RefreshData();
        }
        private void Load款式下的尺寸()
        {
            this.gridControl尺寸表.DataSource =
                    FunctionHelper
                    .JsonDeserialization<List<DTO尺寸>>(
                        RestCall
                        .httpGetMethod(
                            URL.接口url + "/size/findByStyleNameCn?styleNameCn=" + this.styleSonCode
                            )
                        );
            this.gridView尺寸表.RefreshData();
        }
        #endregion

        private void gridView款式销量_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            try
            {
                this.styleSonCode = FunctionHelper.GetgridViewValue(
                    this.gridView款式销量, 
                    this.gridView款式销量.FocusedRowHandle, 
                    "styleCode"
                    );
                this.groupControl当前款式.Text = "当前款式:" + this.styleSonCode;
                this.Load款式下的外观设计点();
                this.Load款式下的工艺设计点();
                this.Load款式下的尺寸();
                //  查询所有工艺设计知识库
                this.gridControl工艺设计.DataSource = 款式迭代Service.getListCraftDesignDTOs();
            } catch { }
        }
        private void simpleButton生效_Click(object sender, EventArgs e)
        {
            //  工艺设计
            foreach (CraftDesignStyleRelationDTO item in this.craftDesignStyleRelationDTOs工艺)
            {
                //  判断位置是否完整
                if (String.IsNullOrEmpty(item.partId))
                {
                    MessageBox.Show("工艺设计的位置不完整");
                    return;
                }
            }
            this.craftDesignStyleRelationDTOs全部.AddRange(this.craftDesignStyleRelationDTOs外观);
            this.craftDesignStyleRelationDTOs全部.AddRange(this.craftDesignStyleRelationDTOs工艺);
            try
            {
                款式迭代Service.saveCraftFacadeStyleDesignDB(this.craftDesignStyleRelationDTOs全部);
                MessageBox.Show("操作成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void excel导入尺寸ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Stopwatch stopWatch = new Stopwatch();
            stopWatch.Start();
            ExcelAndPath excelAndPath = ExcelUtil.getExcelDatasAndPath();
            if (excelAndPath == null)
            {
                return;
            }
            DataSet result = excelAndPath.DataSet;
            stopWatch.Stop();
            System.Diagnostics.Debug.WriteLine("导成Dataset用时" + stopWatch.ElapsedMilliseconds + "ms");
            stopWatch.Start();
            if (result == null)
            {
                return;
            }
            DataTable dataTable = result.Tables[0];
            List<DTO尺寸> list = new List<DTO尺寸>();
            String ITEM_CD;
            String ITEM_VALUE;
            String ITEM_NAME_CN;
            for (int i = 1; i < 100; i++)
            {
                try
                {
                    if (String.IsNullOrEmpty(dataTable.Rows[i]["Column0"].ToString()))
                    {
                        break;
                    }
                }
                catch (Exception)
                {
                    break;
                }
                ITEM_CD = dataTable.Rows[i]["Column0"].ToString();
                ITEM_VALUE = dataTable.Rows[i]["Column1"].ToString();
                ITEM_NAME_CN = dataTable.Rows[i]["Column2"].ToString();
                for (int j = 3; j < 100; j++)
                {
                    try
                    {
                        if (String.IsNullOrEmpty(dataTable.Rows[0]["Column" + j.ToString()].ToString()))
                        {
                            break;
                        }
                    }
                    catch (Exception)
                    {
                        break; ;
                    }
                    list.Add(new DTO尺寸(ITEM_CD, ITEM_VALUE, ITEM_NAME_CN, dataTable.Rows[i]["Column" + j.ToString()].ToString(), this.styleSonCode, "IGS_GROUP_SIZE-" + dataTable.Rows[0]["Column" + j.ToString()].ToString()));
                }
            }
            stopWatch.Stop();
            System.Diagnostics.Debug.WriteLine("导成List用时" + stopWatch.ElapsedMilliseconds + "ms");
            stopWatch.Start();
            new Frm尺寸导入预览(list, this.styleSonCode).ShowDialog();
            //RestCall.PostHttp(URL.接口url + "/size/saveSize", FunctionHelper.JsonSerialization(list));
            stopWatch.Stop();
            System.Diagnostics.Debug.WriteLine("Post用时" + stopWatch.ElapsedMilliseconds + "ms");
            this.Load款式下的尺寸();
            //}
            //catch (Exception ex)
            //{
            //    System.Diagnostics.Debug.WriteLine("====================Excel尺寸导入错误=======================\n" + ex.Message);
            //    MessageBox.Show("导入失败");
            //}
        }

        #region 工艺设计
        private void simpleButton新增工艺_Click(object sender, EventArgs e)
        {
            new Form工艺设计().ShowDialog();
            this.gridControl工艺设计.DataSource = 款式迭代Service.getListCraftDesignDTOs();
        }
        private void simpleButton添加到款式_Click(object sender, EventArgs e)
        {
            if (this.gridView工艺设计.FocusedRowHandle >= 0)
            {
                String craftDesignId =
                    FunctionHelper.GetgridViewValue(
                        this.gridView工艺设计,
                        this.gridView工艺设计.FocusedRowHandle,
                        "id"
                    );
                String craftDesignDesc =
                    FunctionHelper.GetgridViewValue(
                        this.gridView工艺设计,
                        this.gridView工艺设计.FocusedRowHandle,
                        "desc"
                    );
                new Form款式添加工艺(this.styleSonCode,craftDesignId, craftDesignDesc).ShowDialog();
                this.Load款式下的工艺设计点();
            }
            else
            {
                MessageBox.Show("请点击选择要添加的工艺设计");
            }
        }
        private void gridView工艺设计_RowClick(object sender, RowClickEventArgs e)
        {
            if (this.gridView工艺设计.FocusedRowHandle >= 0)
            {
                String craftDesignId =
                    FunctionHelper.GetgridViewValue(
                        this.gridView工艺设计,
                        this.gridView工艺设计.FocusedRowHandle,
                        "id"
                    );
                CraftDesignDTO craftDesignDTO = 款式迭代Service.getCraftDesignDTOById(craftDesignId);
                this.craftDesignStyleRelationDTOs工艺.Add(new CraftDesignStyleRelationDTO(this.styleSonCode,craftDesignDTO));
                this.gridView款式下工艺一览.RefreshData();
            }
            else
            {
                MessageBox.Show("请点击选择要添加的工艺设计");
            }
        }
        private void gridView款式下工艺一览_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            if (e.Column.Name.Equals("gridColumnpartDesc2"))
            {
                if ("".Equals(e.CellValue)|| null == e.CellValue)
                {
                    e.Appearance.BackColor = Color.Red;
                    e.Appearance.ForeColor = Color.White;
                }
                else
                {
                    e.Appearance.BackColor = Color.White;
                    e.Appearance.ForeColor = Color.Black;
                }
            }
        }
        private void gridView款式下工艺一览_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
        {
            if (this.gridView款式下工艺一览.IsRowSelected(this.gridView款式下工艺一览.FocusedRowHandle))
            {
                this.craftIds.Add(FunctionHelper.GetgridViewValue(this.gridView款式下工艺一览, this.gridView款式下工艺一览.FocusedRowHandle, "id"));
            }
            else if(!this.gridView款式下工艺一览.IsRowSelected(this.gridView款式下工艺一览.FocusedRowHandle))
            {
                this.craftIds.Remove(FunctionHelper.GetgridViewValue(this.gridView款式下工艺一览, this.gridView款式下工艺一览.FocusedRowHandle, "id"));
            }
        }
        private void simpleButton工艺选择位置_Click(object sender, EventArgs e)
        {
            if (this.craftIds.Count <= 0)
            {
                MessageBox.Show("请选择要设置位置的工艺设计");
                return;
            }
            new Form款式添加工艺(this.craftDesignStyleRelationDTOs工艺,this.craftIds).ShowDialog();
            this.gridView款式下工艺一览.RefreshData();
        }
        private void 删除工艺设计ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String id = FunctionHelper.GetgridViewValue(
                            this.gridView款式下工艺一览,
                            this.gridView款式下工艺一览.FocusedRowHandle,
                            "id"
                        );
            try
            {
                款式迭代Service.deleteCraftFacadeStyleDesignDBById(id);
            }catch{ }
            for (int i = this.craftDesignStyleRelationDTOs工艺.Count-1; i >= 0; i--)
            {
                if (id.Equals(this.craftDesignStyleRelationDTOs工艺[i].id))
                {
                    this.craftDesignStyleRelationDTOs工艺.Remove(this.craftDesignStyleRelationDTOs工艺[i]);
                    this.gridView款式下工艺一览.RefreshData();
                    return;
                }
            }
        }
        private void simpleButton导出工艺_Click(object sender, EventArgs e)
        {
            if (this.craftDesignStyleRelationDTOs工艺.Count > 0)
            {
                try
                {
                    Stopwatch stopWatch = new Stopwatch();
                    stopWatch.Start();
                    款式迭代Service.exportDataToExcelFile(this.craftDesignStyleRelationDTOs工艺);
                    stopWatch.Stop();
                    System.Diagnostics.Debug.WriteLine("====================款式工艺设计导出时间" + stopWatch.ElapsedMilliseconds + " ms=======================");
                    MessageBox.Show("保存成功");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("无导出内容");
            }
        }
        private void simpleButton导入工艺_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(this.styleSonCode))
            {
                MessageBox.Show("请选择要导入款式");
                return;
            }
            try
            {
                OpenFileDialog openFile = new OpenFileDialog();
                openFile.Filter = MIMEConst.EXCEL_MIME;
                openFile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
                openFile.Multiselect = false;
                if (openFile.ShowDialog() == DialogResult.OK)
                {
                    DataSet result = ExcelUtil.getExcelDatas(openFile.FileName);
                    if (result == null)
                    {
                        MessageBox.Show("无导入内容");
                        return;
                    }
                    DataTable dataTable = result.Tables[0];
                    List<CraftDesignStyleRelationDTO> craftDesignStyleRelationDTOs =
                        款式迭代Service.importDataFromExcelFile(dataTable, this.styleSonCode);
                    new Form款式工艺导入预览(craftDesignStyleRelationDTOs).ShowDialog();
                }                    
                
            }
            catch
            {
                MessageBox.Show("文件有误/文件被占用，操作失败");
                return;
            }
        }
        
        #endregion

        #region 外观设计点相关,隐藏页面
        private void Load款式下的外观设计点()
        {
            try
            {
                this.craftDesignStyleRelationDTOs外观 = 款式迭代Service.getCraftStyleDesignDTOs(CraftTypeConst.APPEARANCE_DESIGN, this.styleSonCode);
            }
            catch
            {
                MessageBox.Show("无外观设计点");
            }
            this.gridControl款式下外观一览.DataSource = this.craftDesignStyleRelationDTOs外观;
            this.gridView款式下外观一览.RefreshData();
        }
        private void simpleButton添加外观设计点_Click(object sender, EventArgs e)
        {
            try
            {
                System.Windows.Forms.FolderBrowserDialog sFD = new System.Windows.Forms.FolderBrowserDialog();
                System.Windows.Forms.DialogResult rdr = sFD.ShowDialog();
                string filePath = sFD.SelectedPath;
                DirectoryInfo root = new DirectoryInfo(filePath);
                FileInfo[] files = root.GetFiles();
                //new Form款式添加外观(this.styleSonCode, files).ShowDialog();

                this.model = new Model款式加外观(files);
                if (this.model.filePictureNames.Count > 0)
                {
                    this.craftFacadeDesignImportDTO = 款式迭代Service.getCraftFacadeDesignImportInfo(this.model.filePictureNames);
                    this.gridControl未完善的外观设计点.DataSource
                        = this.model.build未匹配(this.craftFacadeDesignImportDTO.invalidFacadeValues).newFacadeDesignVOs;
                    this.gridControl外观设计点候选.DataSource = this.craftFacadeDesignImportDTO.craftFacadeDesignDTOList;
                }
            }
            catch
            {
                return;
            }
        }
        private void 补充设计点信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form外观设计 form = new Form外观设计(
                FunctionHelper.getTileView(this.tileView未完善的外观设计点, this.tileView未完善的外观设计点.FocusedRowHandle, "facadeFileName"),
                (Image)this.tileView未完善的外观设计点.GetRowCellValue(this.tileView未完善的外观设计点.FocusedRowHandle, "facadePicture")
                );
            form.ShowDialog();
            if (!String.IsNullOrEmpty(form.id))
            {
                this.model.newFacadeDesignVOs.RemoveAll(o => { return o.facadeFileName.Equals(form.facadeFileName); });
                this.craftFacadeDesignImportDTO.craftFacadeDesignDTOList.Add(款式迭代Service.getCraftFacadeDesignDTO(form.id));
                this.gridView外观设计点候选.RefreshData();
                this.tileView未完善的外观设计点.RefreshData();
            }
        }
        private void simpleButton确认添加外观设计点到款式_Click(object sender, EventArgs e)
        {
            Dictionary<String, String> craftFacadeStyleDesignIdAndDesignIdMap = new Dictionary<string, string>();
            foreach (CraftFacadeDesignDTO item in this.craftFacadeDesignImportDTO.craftFacadeDesignDTOList)
            {
                craftFacadeStyleDesignIdAndDesignIdMap.Add(new FunctionHelper().Uuid, item.id);
            }
            if (!String.IsNullOrEmpty(款式迭代Service.saveCraftFacadeStyleDesign(
                 this.styleSonCode,
                 craftFacadeStyleDesignIdAndDesignIdMap
                 )))
            {
                MessageBox.Show("添加成功");
            }
            else
            {
                MessageBox.Show("添加失败");
            }
            this.craftFacadeDesignImportDTO.craftFacadeDesignDTOList.Clear();
            this.model.newFacadeDesignVOs.Clear();
            this.gridView外观设计点候选.RefreshData();
            this.tileView未完善的外观设计点.RefreshData();
            this.Load款式下的外观设计点();
        }
        private void gridView款式下外观一览_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
        {
            if (e.Column.FieldName == "Photo" && e.IsGetData)
            {
                //RefImage是存储图片路径的那一列
                //String craftDesignId = FunctionHelper.GetgridViewValue(this.gridView款式下外观一览,e.ListSourceRowIndex, "craftDesignId");
                String craftDesignId = this.craftDesignStyleRelationDTOs外观[e.ListSourceRowIndex].craftDesignId;
                if (String.IsNullOrEmpty(craftDesignId))
                {
                    return;
                }
                String filePath = URL.图片url + "//" +
                URL.外观设计点图片路径 + "//" +
                款式迭代Service.getCraftFacadeDesignDTO(craftDesignId).imageFilePath;
                Image img = null;
                try
                {
                    //判断图片路径是否为网络路径
                    if (FunctionHelper.UrlDiscern(filePath))
                    {
                        //文件是否存在
                        if (FunctionHelper.RemoteFileExists(filePath))
                        {
                            //读取文件
                            using (WebClient wc = new WebClient())
                            {
                                img = new Bitmap(wc.OpenRead(filePath));
                            }
                        }
                    }
                    // 判断本地文件是否存在
                    else if (FunctionHelper.LocalFileExists(filePath))
                    {
                        //加载本地图片
                        img = Image.FromFile(filePath);
                    }
                    //pictureEdit列绑定图片
                    e.Value = img;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
        private void gridView外观设计点候选_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
        {
            if (e.Column.FieldName == "holdImage" && e.IsGetData)
            {
                //RefImage是存储图片路径的那一列
                String imageFilePath = this.craftFacadeDesignImportDTO.craftFacadeDesignDTOList[e.ListSourceRowIndex].imageFilePath;
                if (String.IsNullOrEmpty(imageFilePath))
                {
                    return;
                }
                String filePath = URL.图片url + "//" +
                URL.外观设计点图片路径 + "//" + imageFilePath;
                Image img = null;
                try
                {
                    //判断图片路径是否为网络路径
                    if (FunctionHelper.UrlDiscern(filePath))
                    {
                        //文件是否存在
                        if (FunctionHelper.RemoteFileExists(filePath))
                        {
                            //读取文件
                            using (WebClient wc = new WebClient())
                            {
                                img = new Bitmap(wc.OpenRead(filePath));
                            }
                        }
                    }
                    // 判断本地文件是否存在
                    else if (FunctionHelper.LocalFileExists(filePath))
                    {
                        //加载本地图片
                        img = Image.FromFile(filePath);
                    }
                    //pictureEdit列绑定图片
                    e.Value = img;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
        private void toolTipController款式下的外观设计点图片预览_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.Info == null && e.SelectedControl == this.gridControl款式下外观一览)
            {
                GridView view = this.gridControl款式下外观一览.FocusedView as GridView;
                GridHitInfo info = view.CalcHitInfo(e.ControlMousePosition);
                if (info.InRowCell && info.Column.FieldName == "Photo")
                {
                    string cellKey = info.RowHandle.ToString() + " - " + info.Column.ToString();
                    ToolTipControlInfo controlInfo = new ToolTipControlInfo(cellKey, " ");
                    Image image = (Image)view.GetRowCellValue(info.RowHandle, view.Columns["Photo"]);
                    controlInfo.ToolTipImage = image; // resize the image if necessary
                    e.Info = controlInfo;
                }
            }
        }
        private void toolTipController款式下新增外观设计点候选_GetActiveObjectInfo(object sender, ToolTipControllerGetActiveObjectInfoEventArgs e)
        {
            if (e.Info == null && e.SelectedControl == this.gridControl外观设计点候选)
            {
                GridView view = this.gridControl外观设计点候选.FocusedView as GridView;
                GridHitInfo info = view.CalcHitInfo(e.ControlMousePosition);
                if (info.InRowCell && info.Column.FieldName == "holdImage")
                {
                    string cellKey = info.RowHandle.ToString() + " - " + info.Column.ToString();
                    ToolTipControlInfo controlInfo = new ToolTipControlInfo(cellKey, " ");
                    Image image = (Image)view.GetRowCellValue(info.RowHandle, view.Columns["holdImage"]);
                    controlInfo.ToolTipImage = image; // resize the image if necessary
                    e.Info = controlInfo;
                }
            }
        }





        #endregion

        #region 设计点

        #endregion

        private void 新增外观设计点ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form外观设计 form = new Form外观设计();
            form.ShowDialog();
            if (!String.IsNullOrEmpty(form.id))
            {
                Dictionary<String, String> craftFacadeStyleDesignIdAndDesignIdMap = new Dictionary<string, string>();
                craftFacadeStyleDesignIdAndDesignIdMap.Add(new FunctionHelper().Uuid, form.id);
                if (!String.IsNullOrEmpty(款式迭代Service.saveCraftFacadeStyleDesign(
                 this.styleSonCode,
                 craftFacadeStyleDesignIdAndDesignIdMap
                 )))
                {
                    //this.craftFacadeDesignImportDTO.craftFacadeDesignDTOList.Clear();
                    //this.model.newFacadeDesignVOs.Clear();
                    //this.gridView外观设计点候选.RefreshData();
                    //this.tileView未完善的外观设计点.RefreshData();
                    CraftDesignStyleRelationDTO craft = new CraftDesignStyleRelationDTO(款式迭代Service.getCraftFacadeDesignDTO(form.id), styleSonCode);
                    this.craftDesignStyleRelationDTOs外观.Add(craft);
                    款式迭代Service.saveCraftFacadeStyleDesignDB(this.craftDesignStyleRelationDTOs外观);
                    this.Load款式下的外观设计点();
                    MessageBox.Show("添加成功");
                }
                else
                {
                    MessageBox.Show("添加失败");
                }
            }
        }

        private void 删除外观设计点ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            String id = FunctionHelper.GetgridViewValue(
                            this.gridView款式下外观一览,
                            this.gridView款式下外观一览.FocusedRowHandle,
                            "id"
                        );
            try
            {
                款式迭代Service.deleteCraftFacadeStyleDesignDBById(id);
            }
            catch { }
            this.Load款式下的外观设计点();
        }
    }
}
